UDP_Chat is a simple IRC chat type program using UDP. I've added some
horrible hacks to Alvaro Thompson's (once) nice font sensitive code :-)
- Typical bloody games programmer ;-) . I've written it as a game 
communication code test/debugger program.
  You have to have a TCP/IP stack running before you can act as Server or
try to log into a Server. It can act as a Server or a Client- to get the
program to act as Server you have to click on the Server button. You can
have up to 7 other players online (you can set the total number of players
with the `max_number_players' variable). If it logs into another program
(that is acting as Server and has a spare player position) it will be
logged in as a Client (as long as it isn't already a Server)- note it will
still send messages directly to all the other players (when logged on), not
through the Server. You can run up to `max_number_players' UDP_Chat programs
locally for testing, and all can log into the program acting as a Server
- they all get different port numbers. If you're offline you can change the 
`max_number_players' with the Dim_Message_Arrays Function. 
  To Disconnect from a game press the disconnect button, or the Close
gadget in the window. The Disconnect button will disconnect you from the
game if you're a Client, and close down the game and take you out of 
Server mode if you're the Server. The Close gadget will disconnect you
from the game and close the program. If it's a Client it will tell the
Server it's disconnecting, and will wait until it receives confirmation
from the Server before exiting; if it's the Server it will wait until all
players have confirmed the game is closing before disconnecting. There is a
disconnect timeout, in case the disconnect protocol fails- ie: a connection
is lost etc, and it will disconnect anyway after a certain time
(#DISCONNECT_TIMEOUT). 
   Your host address is printed beside the Localhost button. You have to 
give this address to the other person through IRC, if your program is
going to act as Server (or vice-versa), and then they type the address
you give them in the Send To: gadget and hit return. You shouldn't have
to change the port number gadget (unless you've got two of them running
locally- the second one will be bound to a port number one number higher
than the first- the port UDP_Chat is bound to is printed up in the 
top-right corner). You can log into a Server automatically with AmiComSys,
and an Arexx script . Also you could get info from StrICQ, with some extra
coding. Also you make an Arexx program to work with an IRC program to 
automatically log in as well.
  Then just type into the Send: gadget and hit return. Your words will 
be echoed on the screen above and will be sent to any players online.
If you can't connect to a host (it will tell you), you won't have your
words echoed onscreen, and they won't be sent. The numbers after R: and S:
(received and sent), are packet number, and the player the packet is sent
or received from.
   You have to change the constant #NO_CONNECTION at the top of the
code if you're running your programs locally: 1 if you haven't been
online, or 0 if you have been/are online. `Localhost' seems to work 
differently in each case- don't ask me why :-) If you're testing 
programs online it needs to be set to 0. Also you have to set the 
#COMMS_DEBUG constant to 1, which allows you to have multiple copies on one 
machine (otherwise, if it finds that there is already a UDP_Chat Arexx 
port it will exit). It's also for outputting all debug data onscreen.
   The Ping times are printed out beside each player's number, and
you can tell what your player number- `Me' is printed in place of
your Ping time. `Serv' is printed in the Player 1 position if you're 
acting as the Server.
  The `1:' button stops the program for 1 second, the `2:' button
stops the program for 80 seconds. Button `3' prints out your current 
System Time. The `8:' button pauses and unpauses your program- this is for
simulating lags or lost links. The localhost button is for getting your
local IP address if you go online after you've started the program.  You
can send and receive Unreliable messages- button `7:' toggles between
sending Reliable and Unreliable messages. Any sent unreliable messages
have SU at the beginning of the line, and any received unreliable messages
have RU at the beginning. 

UDP_Chat
Converted with g2h, © 24.06.1998 N. DARNIS